package cn.gov.nanhai.commonssys.web.web;

import cn.gov.nanhai.commonssys.web.entity.CollectPlan;
import cn.gov.nanhai.commonssys.web.service.CollectPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by ${董荣盛} on 2021/4/17.
 * @author ASUS
 */
@RestController
public class TestController {

    @Autowired
    private CollectPlanService ps;

    @RequestMapping("/hello")
    public String hello(){
        return "测试成功";
    }

    @RequestMapping("/test")
    public String test(CollectPlan plan){
        System.out.println(plan);
        ps.save(plan);
        return "测试传参";
    }

    @RequestMapping("/test2")
    @CrossOrigin
    public String test2(String name){
        System.out.println(name);
        return "测试传参";
    }


}
